package org.example.demos.pattern.strategy_pattern;

import org.example.demos.pattern.strategy_pattern.dto.LocalLoginDTO;
import org.example.demos.pattern.strategy_pattern.dto.LoginCommonParam;
import org.example.demos.pattern.strategy_pattern.dto.LoginCommonResult;
import org.example.demos.pattern.strategy_pattern.strategy.LoginStrategy;

public class Test {

    public static void main(String[] args) throws Exception {
        String loginType = "localLogin";
        LoginStrategy strategy = LoginStrategyFactory.getStrategy(loginType);

        LoginCommonParam param = new LoginCommonParam();
        LoginCommonResult<LocalLoginDTO> result = strategy.login(param);
        System.out.println(result.getMessage());

    }
}
